package com.sc.myspringbootmo.utils;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBTest {
    public static void main(String[] args) {
        String url = "jdbc:mysql://localhost:3308/myppx?useSSL=false&serverTimezone=Asia/Shanghai";
        String user = "root";
        String password = "1234";
        try (Connection conn = DriverManager.getConnection(url, user, password)) {
            System.out.println("数据库连接成功！");
        } catch (Exception e) {
            e.printStackTrace(); // 打印具体连接失败原因
        }
    }
}